{include file="public/head"/}
<style>
  .main-content {
    margin-left: 0px;
    min-height: 80%;
  }

  .row .cf {
    margin-bottom: 10px;
  }

  .step-content {
    height: 560px;
  }

  .well {
    min-height: 90%;
  }

  table span{
    padding: 0 10px;
  }
</style>


<div class="main-container" id="main-container">
  <script type="text/javascript">
    try {
      ace.settings.check('main-container', 'fixed')
    } catch (e) {
    }
  </script>

  <div class="main-container-inner">
    <a class="menu-toggler" id="menu-toggler" href="#">
      <span class="menu-text"></span>
    </a>
    {include file="public/nav"/}

    <div class="main-content">
      <div class="page-content">
        <div class="row">
          <div class="well">
            <h1 class=" lighter smaller">
              <span class="blue bigger-125">
                <i class="ace-icon fa fa-car"></i>
              </span>
              车辆服务
              <a style="font-size:13px;" href="{:url('main/moduletech')}">返回首页</a>
            </h1>
            <hr>
            <div class="space"></div>

            <div class="row-fluid">
              <form class="form-horizontal" id="fmWork" method="post">
                <input type="hidden" name="id" value="">

                <div class="form-group">
                  <label class="col-sm-3 control-label no-padding-right">工单</label>
                  <div class="col-sm-9">
                    <input name="num" class="col-xs-10 col-sm-5" readonly>
                    <span class="help-inline col-xs-12 col-sm-7">
                      <span class="middle">
                        <a href="#modal-tbWork" data-toggle="modal">选择</a>&nbsp;&nbsp;
                      </span>
                    </span>
                  </div>
                </div>

                <div class="form-group">
                  <label class="col-sm-3 control-label no-padding-right"> 维修技师 </label>
                  <div class="col-sm-9">
                    <div class="radio">
                      {volist name="repairmen" id="r"}
                      <label>
                        <input name="repairman_id" type="radio" class="ace" value="{$r.id}">
                        <span class="lbl">{$r.name}</span>
                      </label>&nbsp;&nbsp;
                      {/volist}
                    </div>
                    <span class="help-inline col-xs-12 col-sm-7">
                      <span class="middle"></span>
                    </span>
                  </div>
                </div>

                <div class="form-group">
                  <label class="col-sm-3 control-label no-padding-right">车牌号</label>
                  <div class="col-sm-9">
                    <input name="car_num" class="col-xs-10 col-sm-5">
                    <span class="help-inline col-xs-12 col-sm-7">
                      <span class="middle"></span>
                    </span>
                  </div>
                </div>

                <div class="form-group">
                  <label class="col-sm-3 control-label no-padding-right">服务项目</label>
                  <div class="col-sm-9">
                    <!--<input name="client_name" class="col-xs-10 col-sm-5">-->
                    <span class="help-inline col-xs-12 col-sm-7">
                      <span class="middle">
                        <a href="#modal-tbGood" data-toggle="modal">选择/添加</a>&nbsp;&nbsp;
                        <!--<a href="#modal-fmGood" data-toggle="modal">添加</a>-->
                      </span>
                    </span>
                  </div>
                </div>

                <div class="form-group">
                  <label class="col-sm-3 control-label no-padding-right">已选服务</label>
                  <div class="col-sm-5">
                    <!--<input type="hidden" name="client_id">
                    <input name="client_name" class="col-xs-10 col-sm-5">
                    <span class="help-inline col-xs-12 col-sm-7">
                      <span class="middle">
                        <a href="#modal-tbGood" data-toggle="modal">选择</a>&nbsp;&nbsp;
                        <a href="#modal-fmGood" data-toggle="modal">添加</a>
                      </span>
                    </span>-->
                    <table class="tbServerSelected tbServer table table-bordered table-striped col-sm-8">
                      <tr>
                        <td>编号</td>
                        <td>产品</td>
                        <td>价钱</td>
                        <td>数量</td>
                        <td>小计</td>
                      </tr>
                    </table>
                  </div>
                </div>

                <div class="col-md-offset-3 col-md-9">
                  <a class="btn btn-info submit" onclick="addCarSingleForm.saveWork(this);">
                    <i class="icon-ok bigger-110"></i>
                    提交
                  </a>
                  <button class="btn" type="reset">
                    <i class="icon-undo bigger-110"></i>
                    重置
                  </button>
                </div>
              </form>
              <!--选择工单模态框-->
              <div id="modal-tbWork" class="modal" tabindex="-1">
                <div class="modal-dialog modal-lg">
                  <div class="modal-content">
                    <div class="modal-header">
                      <button class="close" data-dismiss="modal">&times;</button>
                      <h4 class="blue bigger">选择工单</h4>
                    </div>
                    <div class="modal-body overflow-visible">
                      <!--数据筛选表单-->
                      <form class="form-inline fmWorkQuery-hook">
                        <input class="input-small" name="num" placeholder="工单号"/>
                        <input class="input-small" name="car_num" placeholder="车牌号"/>
                        <input class="input-small" name="client_name" placeholder="客户"/>
                        <button type="button" class="btn btn-info btn-sm" onclick="addCarSingleForm.search();">
                          <i class="fa fa-search bigger-110"></i>
                          查找
                        </button>
                        <button type="button" class="btn btn-primary btn-sm"
                                onclick="addCarSingleForm.searchNull();">
                          <i class="fa fa-remove bigger-110"></i>
                          清空
                        </button>
                      </form>
                      <!--客户数据表-->
                      <table id="tbWork"></table>
                      <!--客户表页码内容-->
                      <div id="tbWorkPager"></div>
                    </div>
                    <div class="modal-footer">
                      <button class="btn btn-sm" data-dismiss="modal">
                        <i class="icon-remove"></i>
                        取消
                      </button>
                      <!--<button class="btn btn-sm btn-primary">
                        <i class="icon-ok"></i>
                        保存
                      </button>-->
                    </div>
                  </div>
                </div>
              </div>

              <!--添加产品模态框-->
              <!--<div id="modal-fmGood" class="modal" tabindex="-1">
                <div class="modal-dialog">
                  <div class="modal-content">
                    <div class="modal-header">
                      <button type="button" class="close" data-dismiss="modal">&times;</button>
                      <h4 class="blue bigger">添加产品信息</h4>
                    </div>
                    <div class="modal-body overflow-visible">
                      &lt;!&ndash;添加客户表单&ndash;&gt;
                      <form class="form-horizontal" id="fmGood" method="post">
                        <input type="hidden" name="id" value="">
                        <div class="form-group">
                          <label class="col-sm-3 control-label no-padding-right"> 编号 </label>
                          <div class="col-sm-9">
                            <input name="num" placeholder="编号" class="col-xs-10 col-sm-5" value="">
                            <span class="help-inline col-xs-12 col-sm-7">
                              <span class="middle"></span>
                            </span>
                          </div>
                        </div>

                        <div class="space-4"></div>

                        <div class="form-group">
                          <label class="col-sm-3 control-label no-padding-right"> 名称 </label>
                          <div class="col-sm-9">
                            <input name="name" placeholder="名称" class="col-xs-10 col-sm-5" value="">
                            <span class="help-inline col-xs-12 col-sm-7">
                              <span class="middle"></span>
                            </span>
                          </div>
                        </div>

                        <div class="form-group">
                          <label class="col-sm-3 control-label no-padding-right"> 单价 </label>
                          <div class="col-sm-9">
                            <input name="price" placeholder="单价" class="col-xs-10 col-sm-5" value="">
                            <span class="middle"></span>
                            </span>
                          </div>
                        </div>

                        <div class="form-group">
                          <label class="col-sm-3 control-label no-padding-right"> 数量 </label>
                          <div class="col-sm-9">
                            <input name="storage" placeholder="数量" class="col-xs-10 col-sm-5" value="">
                            <span class="middle"></span>
                            </span>
                          </div>
                        </div>
                      </form>
                    </div>

                    <div class="modal-footer">
                      <button class="btn btn-sm" data-dismiss="modal">
                        <i class="icon-remove"></i>
                        取消
                      </button>
                      <button class="btn btn-sm btn-primary" data-loading-text="保存中..."
                              onclick="addCarSingleForm.saveGood(this);">
                        <i class="icon-ok"></i>
                        保存
                      </button>
                    </div>
                  </div>
                </div>
              </div>-->

              <!--选择产品模态框-->
              <div id="modal-tbGood" class="modal" tabindex="-1">
                <div class="modal-dialog modal-lg">
                  <div class="modal-content">
                    <div class="modal-header">
                      <button class="close" data-dismiss="modal">&times;</button>
                      <h4 class="blue bigger">选择产品</h4>
                    </div>
                    <div class="modal-body overflow-visible">
                      <!--添加产品表单-->
                      <form class="form-inline fmGoodAdd-hook">
                        <input class="input-small" name="num" placeholder="编号"/>
                        <input class="input-small" name="name" placeholder="名称"/>
                        <input class="input-small" name="storage" placeholder="数量"/>
                        <input class="input-small" name="price" placeholder="单价"/>
                        <button type="button" class="btn btn-info btn-sm" onclick="addCarSingleForm.addGood();">
                          <i class="fa fa-plus bigger-110"></i>
                          添加
                        </button>
                        <button type="reset" class="btn btn-primary btn-sm">
                          <i class="fa fa-reply bigger-110"></i>
                          重置
                        </button>
                      </form>
                      <!--数据筛选表单-->
                      <form class="form-inline fmGoodQuery-hook">
                        <input class="input-small" name="num" placeholder="编号"/>
                        <input class="input-small" name="name" placeholder="名称"/>
                        <input class="input-small" name="price" placeholder="单价"/>
                        <button type="button" class="btn btn-info btn-sm" onclick="addCarSingleForm.searchGood();">
                          <i class="fa fa-search bigger-110"></i>
                          查找
                        </button>
                        <button type="button" class="btn btn-primary btn-sm"
                                onclick="addCarSingleForm.searchNullGood();">
                          <i class="fa fa-remove bigger-110"></i>
                          清空
                        </button>
                      </form>
                      <!--客户数据表-->
                      <table id="tbGood"></table>
                      <!--客户表页码内容-->
                      <div id="tbGoodPager"></div>
                      
                      <!--以选中的-->
                      <table class="tbServerSelected table table-bordered table-striped">
                        <tr>
                          <td>编号</td>
                          <td>产品</td>
                          <td>单价</td>
                          <td>数量</td>
                          <td>小计</td>
                        </tr>
                      </table>
                    </div>
                    <div class="modal-footer">
                      <button class="btn btn-sm" data-dismiss="modal">
                        <i class="icon-remove"></i>
                        取消
                      </button>
                      <button class="btn btn-sm btn-primary" onclick="addCarSingleForm.confirmServe();">
                        <i class="icon-ok"></i>
                        确定
                      </button>
                    </div>
                  </div>
                </div>
              </div>
              <hr>
              <div class="space"></div>
            </div>
          </div><!-- /.row -->
        </div><!-- /.page-content -->
      </div><!-- /.main-content -->

    </div><!-- /.main-container-inner -->

    <a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
      <i class="icon-double-angle-up icon-only bigger-110"></i>
    </a>
  </div>
</div>
  <!-- /.main-container -->
  {include file="public/footerjs"/}

  <script>
    var addCarSingleForm_urls={
      getWork:"{:url('work/getWork')}",
      getGood:"{:url('good/getGood')}",
      addGood:'{:url("good/doAdd")}',
      addWork:'{:url("work/doAddTech")}',
      indexServer:"{:url('server/indexserver')}",
    }
  </script>
  <script src="__ADMIN__/js/car/addcarsingleform.js"></script>
  {include file="public/foot"/}